/**
 * @Project TMHSCFX
 * @Author Tran Manh Hung
 * @Email: hungtmit@gmail.com | tmh@xwebgate.com
 * @Copyright © 2011 TMH. All rights reserved
 * @Createdate Apr 14, 2011
 * @Createtime 3:30:14 PM
 */

package com.tmh.study.fAS3AMTM.chap5
{
	import com.tmh.study.fAS3AMTM.chap3.Arrow;

	import flash.display.Sprite;
	import flash.events.Event;

	public class RotationalVelocity extends Sprite
	{
		private var arrow:Arrow;

		private var vr:Number = 5;

		public function RotationalVelocity()
		{
			super();
			addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
		}

		private function addedToStageHandler(event:Event):void
		{
			initData();
		}

		private function initData():void
		{
			arrow = new Arrow();
			addChild(arrow);
			arrow.x = stage.stageWidth / 2;
			arrow.y = stage.stageHeight / 2;
			addEventListener(Event.ENTER_FRAME, onEnterFrame);
		}

		private function onEnterFrame(event:Event):void
		{
			arrow.rotation += vr;
		}
	}
}